<?php

/**
 * This is the control file.
 * It acts as the medium between the viewOpportunity.php file,
 * and the dbOpportunity.php file.
 */
class Opportunity {

    //these private variables are only accessible in this class,
    //we have to use functions or other methods to use them
    private $opportunityID;
    private $organizationID;
    private $contactID;
    private $title;
    private $numPositionsAvailable;
    private $semester;
    private $payRate;
    private $duration;
    private $responsibilities;
    private $qualifications;
    private $instructions;
    private $comments;
    private $categories;
    private $dateAdded;

    
    function __construct($organizationID, $contactID, $title, $numPositionsAvailable,
            $semester, $payRate, $duration, $responsibilities, $qualifications,
            $instructions, $comments, $categories, $pending, $dateAdded) {
        $this->opportunityID = null;
        $this->organizationID = $organizationID;
        $this->contactID = $contactID;
        $this->title = $title;
        $this->numPositionsAvailable = $numPositionsAvailable;
        $this->semester = $semester;
        $this->payRate = $payRate;
        $this->duration = $duration;
        $this->responsibilities = $responsibilities;
        $this->qualifications = $qualifications;
        $this->instructions = $instructions;
        $this->comments = $comments;
        $this->categories = $categories;
        $this->pending = $pending;
        $this->dateAdded = $dateAdded;
    }

    function setOpportunityID($opportunityID) {
        $this->opportunityID = $opportunityID;
    }

    function setOrganizationID($organizationID) {
        $this->organizationID = $organizationID;
    }

    function setContactID($contactID) {
        $this->contactID = $contactID;
    }

    function setTitle($title) {
        $this->title = $title;
    }

    function setNumPostionsAvailable($numPositionsAvailable) {
        $this->numPositionsAvailable = $numPositionsAvailable;
    }

    function setSemester($semester) {
        $this->semester = $semester;
    }

    function setPayRate($payRate) {
        $this->payRate = $payRate;
    }

    function setDuration($duration) {
        $this->duration = $duration;
    }

    function setResponsibilities($responsibilities) {
        $this->responsibilities = $responsibilities;
    }

    function setQualifications($qualifications) {
        $this->qualifications = $qualifications;
    }

    function setInstructions($instructions) {
        $this->instructions = $instructions;
    }

    function setComments($comments) {
        $this->comments = $comments;
    }

    function setCategories($categories) {
        $this->categories = $categories;
    }

    function setDateAdded($dateAdded) {
        $this->dateAdded = $dateAdded;
    }

    function setPending($pending) {
        $this->pending = $pending;
    }

    function getOpportunityID() {
        return $this->opportunityID;
    }

    function getOrganizationID() {
        return $this->organizationID;
    }

    function getContactID() {
        return $this->contactID;
    }

    function getTitle() {
        return $this->title;
    }

    function getNumPositionsAvailable() {
        return $this->numPositionsAvailable;
    }

    function getSemester() {
        return $this->semester;
    }

    function getPayRate() {
        return $this->payRate;
    }

    function getDuration() {
        return $this->duration;
    }

    function getResponsibilities() {
        return $this->responsibilities;
    }

    function getQualifications() {
        return $this->qualifications;
    }

    function getInstructions() {
        return $this->instructions;
    }

    function getComments() {
        return $this->comments;
    }

    function getCategories() {
        return $this->categories;
    }

    function getDateAdded() {
        return $this->dateAdded;
    }

    function getPending() {
        return $this->pending;
    }

    function printAllAttributes() {
        $output = sprintf("Organization ID: %d, Contact ID: %d, Title: %s,
            Number of Positions Available: %d, Semester: %s, Pay Rate: %s,
            Duration: %s, Responsibilities: %s, Qualifications: %s,
            Instructions: %s, Comments: %s, Categories: %s, Pending %s,
            Date Added: %d.",
                        $this->organizationID, $this->contactID, $this->title,
                        $this->numPositionsAvailable, $this->semester,
                        $this->payrate, $this->duration, $this->responsibilities,
                        $this->qualifications, $this->instructions,
                        $this->comments, $this->categories, $this->pending,
                        $this->dateAdded);
        return $output;
    }

}

?>